package com.zj.transactionspringboot01.service.impl;

import com.zj.transactionspringboot01.domain.Myuser;
import com.zj.transactionspringboot01.domain.Teacher;
import com.zj.transactionspringboot01.service.IteacherService;
import com.zj.transactionspringboot01.service.IuserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class BusinessSelectService {
    @Autowired
    private IuserService userService;

    @Autowired
    private IteacherService teacherService;

    @Transactional
    public int doPropagationSelect(int teacherid, int userid) {
        Teacher res1 = null;
        Myuser user1 = null;
        res1 = teacherService.selectTeacher(teacherid);
        try {
            user1 = userService.selectUser(userid);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(res1);
        int i = 1 / 0;
        System.out.println(user1);
        return 2;
    }



}
